{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "d95881d4",
   "metadata": {},
   "source": [
    "# 第10、11页练习\n",
    "* 记录人：洪梦瑶\n",
    "* 练习心得：注意大小写，报错了就重新回去看一下，看看输入法是不是英文"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8d9ff715",
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "038ecc44",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'win32'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys.platform"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "43c76530",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3.9.12 (main, Apr  4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]\n"
     ]
    }
   ],
   "source": [
    "print(sys.version)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "6b6b88c2",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "35317948",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\HONOR'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.getcwd()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "f78d2a0f",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "environ{'ALLUSERSPROFILE': 'C:\\\\ProgramData',\n",
       "        'APPDATA': 'C:\\\\Users\\\\HONOR\\\\AppData\\\\Roaming',\n",
       "        'COMMONPROGRAMFILES': 'C:\\\\Program Files\\\\Common Files',\n",
       "        'COMMONPROGRAMFILES(X86)': 'C:\\\\Program Files (x86)\\\\Common Files',\n",
       "        'COMMONPROGRAMW6432': 'C:\\\\Program Files\\\\Common Files',\n",
       "        'COMPUTERNAME': 'LAPTOP-D276G08A',\n",
       "        'COMSPEC': 'C:\\\\Windows\\\\system32\\\\cmd.exe',\n",
       "        'CONDA_DEFAULT_ENV': 'base',\n",
       "        'CONDA_EXE': 'C:\\\\ProgramData\\\\Anaconda3\\\\Scripts\\\\conda.exe',\n",
       "        'CONDA_PROMPT_MODIFIER': '(base) ',\n",
       "        'CONDA_PYTHON_EXE': 'C:\\\\ProgramData\\\\Anaconda3\\\\python.exe',\n",
       "        'CONDA_SHLVL': '1',\n",
       "        'DRIVERDATA': 'C:\\\\Windows\\\\System32\\\\Drivers\\\\DriverData',\n",
       "        'HOMEDRIVE': 'C:',\n",
       "        'HOMEPATH': '\\\\Users\\\\HONOR',\n",
       "        'INTEL_DEV_REDIST': 'C:\\\\Program Files (x86)\\\\Common Files\\\\Intel\\\\Shared Libraries\\\\',\n",
       "        'LOCALAPPDATA': 'C:\\\\Users\\\\HONOR\\\\AppData\\\\Local',\n",
       "        'LOGONSERVER': '\\\\\\\\LAPTOP-D276G08A',\n",
       "        'MIC_LD_LIBRARY_PATH': 'C:\\\\Program Files (x86)\\\\Common Files\\\\Intel\\\\Shared Libraries\\\\compiler\\\\lib\\\\mic',\n",
       "        'NUMBER_OF_PROCESSORS': '8',\n",
       "        'ONEDRIVE': 'C:\\\\Users\\\\HONOR\\\\OneDrive',\n",
       "        'OS': 'Windows_NT',\n",
       "        'PATH': 'C:\\\\ProgramData\\\\Anaconda3;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\mingw-w64\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\usr\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Scripts;C:\\\\ProgramData\\\\Anaconda3\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\condabin;C:\\\\ProgramData\\\\Anaconda3;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\mingw-w64\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\usr\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\Scripts;C:\\\\Program Files (x86)\\\\Common Files\\\\Intel\\\\Shared Libraries\\\\redist\\\\intel64\\\\compiler;C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Windows\\\\System32\\\\Wbem;C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0;C:\\\\Windows\\\\System32\\\\OpenSSH;C:\\\\Program Files (x86)\\\\NVIDIA Corporation\\\\PhysX\\\\Common;C:\\\\Program Files\\\\NVIDIA Corporation\\\\NVIDIA NvDLISR;E:\\\\寰\\ue1bb俊web寮€鍙戣€呭伐鍏穃dll;C:\\\\ProgramData\\\\Anaconda3;C:\\\\ProgramData\\\\Anaconda3\\\\Scripts;C:\\\\ProgramData\\\\Anaconda3\\\\Library\\\\mingw-w64\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\usr\\\\bin;C:\\\\ProgramData\\\\Anaconda3\\\\bin;C:\\\\Users\\\\HONOR\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps;D:\\\\Users\\\\HONOR\\\\AppData\\\\Local\\\\Programs\\\\Microsoft VS Code\\\\bin;C:\\\\Users\\\\HONOR\\\\AppData\\\\Local\\\\GitHubDesktop\\\\bin',\n",
       "        'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',\n",
       "        'PROCESSOR_ARCHITECTURE': 'AMD64',\n",
       "        'PROCESSOR_IDENTIFIER': 'Intel64 Family 6 Model 140 Stepping 1, GenuineIntel',\n",
       "        'PROCESSOR_LEVEL': '6',\n",
       "        'PROCESSOR_REVISION': '8c01',\n",
       "        'PROGRAMDATA': 'C:\\\\ProgramData',\n",
       "        'PROGRAMFILES': 'C:\\\\Program Files',\n",
       "        'PROGRAMFILES(X86)': 'C:\\\\Program Files (x86)',\n",
       "        'PROGRAMW6432': 'C:\\\\Program Files',\n",
       "        'PROMPT': '(base) $P$G',\n",
       "        'PSMODULEPATH': 'C:\\\\Program Files\\\\WindowsPowerShell\\\\Modules;C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\Modules',\n",
       "        'PUBLIC': 'C:\\\\Users\\\\Public',\n",
       "        'SESSIONNAME': 'Console',\n",
       "        'SYSTEMDRIVE': 'C:',\n",
       "        'SYSTEMROOT': 'C:\\\\Windows',\n",
       "        'TEMP': 'C:\\\\Users\\\\HONOR\\\\AppData\\\\Local\\\\Temp',\n",
       "        'TMP': 'C:\\\\Users\\\\HONOR\\\\AppData\\\\Local\\\\Temp',\n",
       "        'USERDOMAIN': 'LAPTOP-D276G08A',\n",
       "        'USERDOMAIN_ROAMINGPROFILE': 'LAPTOP-D276G08A',\n",
       "        'USERNAME': 'HONOR',\n",
       "        'USERPROFILE': 'C:\\\\Users\\\\HONOR',\n",
       "        'WINDIR': 'C:\\\\Windows',\n",
       "        'ZES_ENABLE_SYSMAN': '1',\n",
       "        'CONDA_PREFIX': 'C:\\\\ProgramData\\\\Anaconda3',\n",
       "        'CONDA_ROOT': 'C:\\\\ProgramData\\\\Anaconda3',\n",
       "        'PYDEVD_USE_FRAME_EVAL': 'NO',\n",
       "        'JPY_INTERRUPT_EVENT': '2116',\n",
       "        'IPY_INTERRUPT_EVENT': '2116',\n",
       "        'JPY_PARENT_PID': '2452',\n",
       "        'TERM': 'xterm-color',\n",
       "        'CLICOLOR': '1',\n",
       "        'PAGER': 'cat',\n",
       "        'GIT_PAGER': 'cat',\n",
       "        'MPLBACKEND': 'module://matplotlib_inline.backend_inline'}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.environ"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "bb850f21",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'cat'"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.getenv('PAGER')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "55d51aab",
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "b33ba1d4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2022, 9, 5)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "52e5f69a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "139005da",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().month"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "c68f4136",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2022"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().year"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "f37aa016",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2022-09-05'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.isoformat(datetime.date.today())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "043ec07f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "1186e702",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'22:26'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.strftime(\"%H:%M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "9e273edb",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "b6e4ca8a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Monday PM'"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.strftime(\"%A %p\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
